package com.morphiastic.conversion;

import org.bson.types.ObjectId;

public class ObjectIdConverter extends ElasticConverter<ObjectId>{

	@Override
	public ObjectId fromIndexValue(Object val) {
//		System.out.println("ObjectIdConverter passed value " + val.toString() );
//		System.out.println("objectID converter : " + new ObjectId(val.toString()));
		return new ObjectId(val.toString());
	}

	
	@Override
	public String toIndexValue(Object value) {
		if(value == null)return null;
		return value.toString();
	}

	
}
